home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Include / object.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-10  |  18.2 KB  |  546 lines

  1. #ifndef Py_OBJECT_H
  2. #define Py_OBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Object and type object interface */
  8.  
  9. /*
  10. Objects are structures allocated on the heap.  Special rules apply to
  11. the use of objects to ensure they are properly garbage-collected.
  12. Objects are never allocated statically or on the stack; they must be
  13. accessed through special macros and functions only.  (Type objects are
  14. exceptions to the first rule; the standard types are represented by
  15. statically initialized type objects.)
  16.  
  17. An object has a 'reference count' that is increased or decreased when a
  18. pointer to the object is copied or deleted; when the reference count
  19. reaches zero there are no references to the object left and it can be
  20. removed from the heap.
  21.  
  22. An object has a 'type' that determines what it represents and what kind
  23. of data it contains.  An object's type is fixed when it is created.
  24. Types themselves are represented as objects; an object contains a
  25. pointer to the corresponding type object.  The type itself has a type
  26. pointer pointing to the object representing the type 'type', which
  27. contains a pointer to itself!).
  28.  
  29. Objects do not float around in memory; once allocated an object keeps
  30. the same size and address.  Objects that must hold variable-size data
  31. can contain pointers to variable-size parts of the object.  Not all
  32. objects of the same type have the same size; but the size cannot change
  33. after allocation.  (These restrictions are made so a reference to an
  34. object can be simply a pointer -- moving an object would require
  35. updating all the pointers, and changing an object's size would require
  36. moving it if there was another object right next to it.)
  37.  
  38. Objects are always accessed through pointers of the type 'PyObject *'.
  39. The type 'PyObject' is a structure that only contains the reference count
  40. and the type pointer.  The actual memory allocated for an object
  41. contains other data that can only be accessed after casting the pointer
  42. to a pointer to a longer structure type.  This longer type must start
  43. with the reference count and type fields; the macro PyObject_HEAD should be
  44. used for this (to accomodate for future changes).  The implementation
  45. of a particular object type can cast the object pointer to the proper
  46. type and back.
  47.  
  48. A standard interface exists for objects that contain an array of items
  49. whose size is determined when the object is allocated.
  50. */
  51.  
  52. #ifdef Py_DEBUG
  53.  
  54. /* Turn on heavy reference debugging */
  55. #define Py_TRACE_REFS
  56.  
  57. /* Turn on reference counting */
  58. #define Py_REF_DEBUG
  59.  
  60. #endif /* Py_DEBUG */
  61.  
  62. #ifdef Py_TRACE_REFS
  63. #define PyObject_HEAD \
  64.     struct _object *_ob_next, *_ob_prev; \
  65.     int ob_refcnt; \
  66.     struct _typeobject *ob_type;
  67. #define PyObject_HEAD_INIT(type) 0, 0, 1, type,
  68. #else /* !Py_TRACE_REFS */
  69. #define PyObject_HEAD \
  70.     int ob_refcnt; \
  71.     struct _typeobject *ob_type;
  72. #define PyObject_HEAD_INIT(type) 1, type,
  73. #endif /* !Py_TRACE_REFS */
  74.  
  75. #define PyObject_VAR_HEAD \
  76.     PyObject_HEAD \
  77.     int ob_size; /* Number of items in variable part */
  78.  
  79. typedef struct _object {
  80.     PyObject_HEAD
  81. } PyObject;
  82.  
  83. typedef struct {
  84.     PyObject_VAR_HEAD
  85. } PyVarObject;
  86.  
  87.  
  88. /*
  89. Type objects contain a string containing the type name (to help somewhat
  90. in debugging), the allocation parameters (see newobj() and newvarobj()),
  91. and methods for accessing objects of the type.  Methods are optional,a
  92. nil pointer meaning that particular kind of access is not available for
  93. this type.  The Py_DECREF() macro uses the tp_dealloc method without
  94. checking for a nil pointer; it should always be implemented except if
  95. the implementation can guarantee that the reference count will never
  96. reach zero (e.g., for type objects).
  97.  
  98. NB: the methods for certain type groups are now contained in separate
  99. method blocks.
  100. */
  101.  
  102. typedef PyObject * (*unaryfunc) Py_PROTO((PyObject *));
  103. typedef PyObject * (*binaryfunc) Py_PROTO((PyObject *, PyObject *));
  104. typedef PyObject * (*ternaryfunc) Py_PROTO((PyObject *, PyObject *, PyObject *));
  105. typedef int (*inquiry) Py_PROTO((PyObject *));
  106. typedef int (*coercion) Py_PROTO((PyObject **, PyObject **));
  107. typedef PyObject *(*intargfunc) Py_PROTO((PyObject *, int));
  108. typedef PyObject *(*intintargfunc) Py_PROTO((PyObject *, int, int));
  109. typedef int(*intobjargproc) Py_PROTO((PyObject *, int, PyObject *));
  110. typedef int(*intintobjargproc) Py_PROTO((PyObject *, int, int, PyObject *));
  111. typedef int(*objobjargproc) Py_PROTO((PyObject *, PyObject *, PyObject *));
  112. typedef int (*getreadbufferproc) Py_PROTO((PyObject *, int, void **));
  113. typedef int (*getwritebufferproc) Py_PROTO((PyObject *, int, void **));
  114. typedef int (*getsegcountproc) Py_PROTO((PyObject *, int *));
  115. typedef int (*getcharbufferproc) Py_PROTO((PyObject *, int, const char **));
  116. typedef int (*objobjproc) Py_PROTO((PyObject *, PyObject *));
  117.  
  118. typedef struct {
  119.     binaryfunc nb_add;
  120.     binaryfunc nb_subtract;
  121.     binaryfunc nb_multiply;
  122.     binaryfunc nb_divide;
  123.     binaryfunc nb_remainder;
  124.     binaryfunc nb_divmod;
  125.     ternaryfunc nb_power;
  126.     unaryfunc nb_negative;
  127.     unaryfunc nb_positive;
  128.     unaryfunc nb_absolute;
  129.     inquiry nb_nonzero;
  130.     unaryfunc nb_invert;
  131.     binaryfunc nb_lshift;
  132.     binaryfunc nb_rshift;
  133.     binaryfunc nb_and;
  134.     binaryfunc nb_xor;
  135.     binaryfunc nb_or;
  136.     coercion nb_coerce;
  137.     unaryfunc nb_int;
  138.     unaryfunc nb_long;
  139.     unaryfunc nb_float;
  140.     unaryfunc nb_oct;
  141.     unaryfunc nb_hex;
  142. } PyNumberMethods;
  143.  
  144. typedef struct {
  145.     inquiry sq_length;
  146.     binaryfunc sq_concat;
  147.     intargfunc sq_repeat;
  148.     intargfunc sq_item;
  149.     intintargfunc sq_slice;
  150.     intobjargproc sq_ass_item;
  151.     intintobjargproc sq_ass_slice;
  152.     objobjproc sq_contains;
  153. } PySequenceMethods;
  154.  
  155. typedef struct {
  156.     inquiry mp_length;
  157.     binaryfunc mp_subscript;
  158.     objobjargproc mp_ass_subscript;
  159. } PyMappingMethods;
  160.  
  161. typedef struct {
  162.     getreadbufferproc bf_getreadbuffer;
  163.     getwritebufferproc bf_getwritebuffer;
  164.     getsegcountproc bf_getsegcount;
  165.     getcharbufferproc bf_getcharbuffer;
  166. } PyBufferProcs;
  167.     
  168.  
  169. typedef void (*destructor) Py_PROTO((PyObject *));
  170. typedef int (*printfunc) Py_PROTO((PyObject *, FILE *, int));
  171. typedef PyObject *(*getattrfunc) Py_PROTO((PyObject *, char *));
  172. typedef PyObject *(*getattrofunc) Py_PROTO((PyObject *, PyObject *));
  173. typedef int (*setattrfunc) Py_PROTO((PyObject *, char *, PyObject *));
  174. typedef int (*setattrofunc) Py_PROTO((PyObject *, PyObject *, PyObject *));
  175. typedef int (*cmpfunc) Py_PROTO((PyObject *, PyObject *));
  176. typedef PyObject *(*reprfunc) Py_PROTO((PyObject *));
  177. typedef long (*hashfunc) Py_PROTO((PyObject *));
  178.  
  179. typedef struct _typeobject {
  180.     PyObject_VAR_HEAD
  181.     char *tp_name; /* For printing */
  182.     int tp_basicsize, tp_itemsize; /* For allocation */
  183.     
  184.     /* Methods to implement standard operations */
  185.     
  186.     destructor tp_dealloc;
  187.     printfunc tp_print;
  188.     getattrfunc tp_getattr;
  189.     setattrfunc tp_setattr;
  190.     cmpfunc tp_compare;
  191.     reprfunc tp_repr;
  192.     
  193.     /* Method suites for standard classes */
  194.     
  195.     PyNumberMethods *tp_as_number;
  196.     PySequenceMethods *tp_as_sequence;
  197.     PyMappingMethods *tp_as_mapping;
  198.  
  199.     /* More standard operations (here for binary compatibility) */
  200.  
  201.     hashfunc tp_hash;
  202.     ternaryfunc tp_call;
  203.     reprfunc tp_str;
  204.     getattrofunc tp_getattro;
  205.     setattrofunc tp_setattro;
  206.  
  207.     /* Functions to access object as input/output buffer */
  208.     PyBufferProcs *tp_as_buffer;
  209.     
  210.     /* Flags to define presence of optional/expanded features */
  211.     long tp_flags;
  212.  
  213.     char *tp_doc; /* Documentation string */
  214.  
  215.     /* More spares */
  216.     long tp_xxx5;
  217.     long tp_xxx6;
  218.     long tp_xxx7;
  219.     long tp_xxx8;
  220.  
  221. #ifdef COUNT_ALLOCS
  222.     /* these must be last */
  223.     int tp_alloc;
  224.     int tp_free;
  225.     int tp_maxalloc;
  226.     struct _typeobject *tp_next;
  227. #endif
  228. } PyTypeObject;
  229.  
  230. extern DL_IMPORT(PyTypeObject) PyType_Type; /* The type of type objects */
  231.  
  232. #define PyType_Check(op) ((op)->ob_type == &PyType_Type)
  233.  
  234. /* Generic operations on objects */
  235. extern DL_IMPORT(int) PyObject_Print Py_PROTO((PyObject *, FILE *, int));
  236. extern DL_IMPORT(PyObject *) PyObject_Repr Py_PROTO((PyObject *));
  237. extern DL_IMPORT(PyObject *) PyObject_Str Py_PROTO((PyObject *));
  238. extern DL_IMPORT(int) PyObject_Compare Py_PROTO((PyObject *, PyObject *));
  239. extern DL_IMPORT(PyObject *) PyObject_GetAttrString Py_PROTO((PyObject *, char *));
  240. extern DL_IMPORT(int) PyObject_SetAttrString Py_PROTO((PyObject *, char *, PyObject *));
  241. extern DL_IMPORT(int) PyObject_HasAttrString Py_PROTO((PyObject *, char *));
  242. extern DL_IMPORT(PyObject *) PyObject_GetAttr Py_PROTO((PyObject *, PyObject *));
  243. extern DL_IMPORT(int) PyObject_SetAttr Py_PROTO((PyObject *, PyObject *, PyObject *));
  244. extern DL_IMPORT(int) PyObject_HasAttr Py_PROTO((PyObject *, PyObject *));
  245. extern DL_IMPORT(long) PyObject_Hash Py_PROTO((PyObject *));
  246. extern DL_IMPORT(int) PyObject_IsTrue Py_PROTO((PyObject *));
  247. extern DL_IMPORT(int) PyObject_Not Py_PROTO((PyObject *));
  248. extern DL_IMPORT(int) PyCallable_Check Py_PROTO((PyObject *));
  249. extern DL_IMPORT(int) PyNumber_Coerce Py_PROTO((PyObject **, PyObject **));
  250. extern DL_IMPORT(int) PyNumber_CoerceEx Py_PROTO((PyObject **, PyObject **));
  251.  
  252. /* Helpers for printing recursive container types */
  253. extern DL_IMPORT(int) Py_ReprEnter Py_PROTO((PyObject *));
  254. extern DL_IMPORT(void) Py_ReprLeave Py_PROTO((PyObject *));
  255.  
  256. /* tstate dict key for PyObject_Compare helper */
  257. extern PyObject *_PyCompareState_Key;
  258.  
  259. /* Flag bits for printing: */
  260. #define Py_PRINT_RAW    1    /* No string quotes etc. */
  261.  
  262. /*
  263.  
  264. Type flags (tp_flags)
  265.  
  266. These flags are used to extend the type structure in a backwards-compatible
  267. fashion. Extensions can use the flags to indicate (and test) when a given
  268. type structure contains a new feature. The Python core will use these when
  269. introducing new functionality between major revisions (to avoid mid-version
  270. changes in the PYTHON_API_VERSION).
  271.  
  272. Arbitration of the flag bit positions will need to be coordinated among
  273. all extension writers who publically release their extensions (this will
  274. be fewer than you might expect!)..
  275.  
  276. Python 1.5.2 introduced the bf_getcharbuffer slot into PyBufferProcs.
  277.  
  278. Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value.
  279.  
  280. Code can use PyType_HasFeature(type_ob, flag_value) to test whether the
  281. given type object has a specified feature.
  282.  
  283. */
  284.  
  285. /* PyBufferProcs contains bf_getcharbuffer */
  286. #define Py_TPFLAGS_HAVE_GETCHARBUFFER  (1L<<0)
  287.  
  288. /* PySequenceMethods contains sq_contains */
  289. #define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1)
  290.  
  291. #define Py_TPFLAGS_DEFAULT  (Py_TPFLAGS_HAVE_GETCHARBUFFER | \
  292.                              Py_TPFLAGS_HAVE_SEQUENCE_IN)
  293.  
  294. #define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)
  295.  
  296.  
  297. /*
  298. The macros Py_INCREF(op) and Py_DECREF(op) are used to increment or decrement
  299. reference counts.  Py_DECREF calls the object's deallocator function; for
  300. objects that don't contain references to other objects or heap memory
  301. this can be the standard function free().  Both macros can be used
  302. whereever a void expression is allowed.  The argument shouldn't be a
  303. NIL pointer.  The macro _Py_NewReference(op) is used only to initialize
  304. reference counts to 1; it is defined here for convenience.
  305.  
  306. We assume that the reference count field can never overflow; this can
  307. be proven when the size of the field is the same as the pointer size
  308. but even with a 16-bit reference count field it is pretty unlikely so
  309. we ignore the possibility.  (If you are paranoid, make it a long.)
  310.  
  311. Type objects should never be deallocated; the type pointer in an object
  312. is not considered to be a reference to the type object, to save
  313. complications in the deallocation function.  (This is actually a
  314. decision that's up to the implementer of each new type so if you want,
  315. you can count such references to the type object.)
  316.  
  317. *** WARNING*** The Py_DECREF macro must have a side-effect-free argument
  318. since it may evaluate its argument multiple times.  (The alternative
  319. would be to mace it a proper function or assign it to a global temporary
  320. variable first, both of which are slower; and in a multi-threaded
  321. environment the global variable trick is not safe.)
  322. */
  323.  
  324. #ifdef Py_TRACE_REFS
  325. #ifndef Py_REF_DEBUG
  326. #define Py_REF_DEBUG
  327. #endif
  328. #endif
  329.  
  330. #ifdef Py_TRACE_REFS
  331. extern DL_IMPORT(void) _Py_Dealloc Py_PROTO((PyObject *));
  332. extern DL_IMPORT(void) _Py_NewReference Py_PROTO((PyObject *));
  333. extern DL_IMPORT(void) _Py_ForgetReference Py_PROTO((PyObject *));
  334. extern DL_IMPORT(void) _Py_PrintReferences Py_PROTO((FILE *));
  335. extern DL_IMPORT(void) _Py_ResetReferences Py_PROTO((void));
  336. #endif
  337.  
  338. #ifndef Py_TRACE_REFS
  339. #ifdef COUNT_ALLOCS
  340. #define _Py_Dealloc(op) ((op)->ob_type->tp_free++, (*(op)->ob_type->tp_dealloc)((PyObject *)(op)))
  341. #define _Py_ForgetReference(op) ((op)->ob_type->tp_free++)
  342. #else /* !COUNT_ALLOCS */
  343. #define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op))
  344. #define _Py_ForgetReference(op) /*empty*/
  345. #endif /* !COUNT_ALLOCS */
  346. #endif /* !Py_TRACE_REFS */
  347.  
  348. #ifdef COUNT_ALLOCS
  349. extern DL_IMPORT(void) inc_count Py_PROTO((PyTypeObject *));
  350. #endif
  351.  
  352. #ifdef Py_REF_DEBUG
  353.  
  354. extern DL_IMPORT(long) _Py_RefTotal;
  355.  
  356. #ifndef Py_TRACE_REFS
  357. #ifdef COUNT_ALLOCS
  358. #define _Py_NewReference(op) (inc_count((op)->ob_type), _Py_RefTotal++, (op)->ob_refcnt = 1)
  359. #else
  360. #define _Py_NewReference(op) (_Py_RefTotal++, (op)->ob_refcnt = 1)
  361. #endif
  362. #endif /* !Py_TRACE_REFS */
  363.  
  364. #define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++)
  365. #define Py_DECREF(op) \
  366.     if (--_Py_RefTotal, --(op)->ob_refcnt != 0) \
  367.         ; \
  368.     else \
  369.         _Py_Dealloc((PyObject *)(op))
  370. #else /* !Py_REF_DEBUG */
  371.  
  372. #ifdef COUNT_ALLOCS
  373. #define _Py_NewReference(op) (inc_count((op)->ob_type), (op)->ob_refcnt = 1)
  374. #else
  375. #define _Py_NewReference(op) ((op)->ob_refcnt = 1)
  376. #endif
  377.  
  378. #define Py_INCREF(op) ((op)->ob_refcnt++)
  379. #define Py_DECREF(op) \
  380.     if (--(op)->ob_refcnt != 0) \
  381.         ; \
  382.     else \
  383.         _Py_Dealloc((PyObject *)(op))
  384. #endif /* !Py_REF_DEBUG */
  385.  
  386. /* Macros to use in case the object pointer may be NULL: */
  387.  
  388. #define Py_XINCREF(op) if ((op) == NULL) ; else Py_INCREF(op)
  389. #define Py_XDECREF(op) if ((op) == NULL) ; else Py_DECREF(op)
  390.  
  391. /* Definition of NULL, so you don't have to include <stdio.h> */
  392.  
  393. #ifndef NULL
  394. #define NULL 0
  395. #endif
  396.  
  397.  
  398. /*
  399. _Py_NoneStruct is an object of undefined type which can be used in contexts
  400. where NULL (nil) is not suitable (since NULL often means 'error').
  401.  
  402. Don't forget to apply Py_INCREF() when returning this value!!!
  403. */
  404.  
  405. extern DL_IMPORT(PyObject) _Py_NoneStruct; /* Don't use this directly */
  406.  
  407. #define Py_None (&_Py_NoneStruct)
  408.  
  409.  
  410. /*
  411. A common programming style in Python requires the forward declaration
  412. of static, initialized structures, e.g. for a type object that is used
  413. by the functions whose address must be used in the initializer.
  414. Some compilers (notably SCO ODT 3.0, I seem to remember early AIX as
  415. well) botch this if you use the static keyword for both declarations
  416. (they allocate two objects, and use the first, uninitialized one until
  417. the second declaration is encountered).  Therefore, the forward
  418. declaration should use the 'forwardstatic' keyword.  This expands to
  419. static on most systems, but to extern on a few.  The actual storage
  420. and name will still be static because the second declaration is
  421. static, so no linker visible symbols will be generated.  (Standard C
  422. compilers take offense to the extern forward declaration of a static
  423. object, so I can't just put extern in all cases. :-( )
  424. */
  425.  
  426. #ifdef BAD_STATIC_FORWARD
  427. #define staticforward extern
  428. #ifdef __SC__
  429. #define statichere
  430. #else
  431. #define statichere static
  432. #endif /* __SC__ */
  433. #else /* !BAD_STATIC_FORWARD */
  434. #define staticforward static
  435. #define statichere static
  436. #endif /* !BAD_STATIC_FORWARD */
  437.  
  438.  
  439. /*
  440. More conventions
  441. ================
  442.  
  443. Argument Checking
  444. -----------------
  445.  
  446. Functions that take objects as arguments normally don't check for nil
  447. arguments, but they do check the type of the argument, and return an
  448. error if the function doesn't apply to the type.
  449.  
  450. Failure Modes
  451. -------------
  452.  
  453. Functions may fail for a variety of reasons, including running out of
  454. memory.  This is communicated to the caller in two ways: an error string
  455. is set (see errors.h), and the function result differs: functions that
  456. normally return a pointer return NULL for failure, functions returning
  457. an integer return -1 (which could be a legal return value too!), and
  458. other functions return 0 for success and -1 for failure.
  459. Callers should always check for errors before using the result.
  460.  
  461. Reference Counts
  462. ----------------
  463.  
  464. It takes a while to get used to the proper usage of reference counts.
  465.  
  466. Functions that create an object set the reference count to 1; such new
  467. objects must be stored somewhere or destroyed again with Py_DECREF().
  468. Functions that 'store' objects such as PyTuple_SetItem() and
  469. PyDict_SetItemString()
  470. don't increment the reference count of the object, since the most
  471. frequent use is to store a fresh object.  Functions that 'retrieve'
  472. objects such as PyTuple_GetItem() and PyDict_GetItemString() also
  473. don't increment
  474. the reference count, since most frequently the object is only looked at
  475. quickly.  Thus, to retrieve an object and store it again, the caller
  476. must call Py_INCREF() explicitly.
  477.  
  478. NOTE: functions that 'consume' a reference count like
  479. PyList_SetItemString() even consume the reference if the object wasn't
  480. stored, to simplify error handling.
  481.  
  482. It seems attractive to make other functions that take an object as
  483. argument consume a reference count; however this may quickly get
  484. confusing (even the current practice is already confusing).  Consider
  485. it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at
  486. times.
  487. */
  488.  
  489. /*
  490.   trashcan
  491.   CT 2k0130
  492.   non-recursively destroy nested objects
  493.  
  494.   CT 2k0223
  495.   redefinition for better locality and less overhead.
  496.  
  497.   Objects that want to be recursion safe need to use
  498.   the macroes 
  499.         Py_TRASHCAN_SAFE_BEGIN(name)
  500.   and
  501.         Py_TRASHCAN_SAFE_END(name)
  502.   surrounding their actual deallocation code.
  503.  
  504.   It would be nice to do this using the thread state.
  505.   Also, we could do an exact stack measure then.
  506.   Unfortunately, deallocations also take place when
  507.   the thread state is undefined.
  508.  
  509.   CT 2k0422 complete rewrite.
  510.   There is no need to allocate new objects.
  511.   Everything is done vialob_refcnt and ob_type now.
  512.   Adding support for free-threading should be easy, too.
  513. */
  514.  
  515. #define PyTrash_UNWIND_LEVEL 50
  516.  
  517. #define Py_TRASHCAN_SAFE_BEGIN(op) \
  518.     { \
  519.         ++_PyTrash_delete_nesting; \
  520.         if (_PyTrash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
  521.  
  522. #define Py_TRASHCAN_SAFE_END(op) \
  523.         ;} \
  524.         else \
  525.             _PyTrash_deposit_object((PyObject*)op);\
  526.         --_PyTrash_delete_nesting; \
  527.         if (_PyTrash_delete_later && _PyTrash_delete_nesting <= 0) \
  528.             _PyTrash_destroy_chain(); \
  529.     } \
  530.  
  531. extern DL_IMPORT(void) _PyTrash_deposit_object Py_PROTO((PyObject*));
  532. extern DL_IMPORT(void) _PyTrash_destroy_chain Py_PROTO((void));
  533.  
  534. extern DL_IMPORT(int) _PyTrash_delete_nesting;
  535. extern DL_IMPORT(PyObject *) _PyTrash_delete_later;
  536.  
  537. /* swap the "xx" to check the speed loss */
  538.  
  539. #define xxPy_TRASHCAN_SAFE_BEGIN(op) 
  540. #define xxPy_TRASHCAN_SAFE_END(op) ;
  541.  
  542. #ifdef __cplusplus
  543. }
  544. #endif
  545. #endif /* !Py_OBJECT_H */
  546.